This method calculates the Fast Stochastic.
var STOCHF(fastKPeriod, fastDPeriod, maType, highPricesArray, lowPricesArray, closePricesArray, calculatedFastKArray, calculatedFastDArray);
fastKPeriod
Fast K period integer value.
fastDPeriod
Fast D period integer value.
maType
One of the Moving Average constants.
highPricesArray
Array object filled with high prices.
lowPricesArray
Array object filled with low prices.
closePricesArray
Array object filled with close prices.
calculatedFastKArray
Empty Array object that will be filled with fast K calculated data.
calculatedFastDArray
Empty Array object that will be filled with fast D calculated data.
Returns true if calculation was completed successfully, or false otherwise.
The following example demonstrates how to use STOCHF method.
function calculate(beginIndex, endIndex)
{
var fastKPeriod = 15;
var fastDPeriod = 5;
var maType = TechnicalAnalysis.MA_EMA;
var highPricesArray = new Array();
var lowPricesArray = new Array();
var closePricesArray = new Array();
//populate arrays..
..
..
..
var calculatedFastKArray = new Array();
var calculatedFastDArray = new Array();
var rc = TechnicalAnalysis.STOCHF(fastKPeriod, fastDPeriod, maType, highPricesArray, lowPricesArray,
closePricesArray, calculatedFastKArray, calculatedFastDArray);
}
Copyright © 2006-2009 ActiveTick LLC